<?php
namespace SinoPHP\BbdBoss\Model;

use Upfor\UpforPHP\Model;


/**
* 平台域名
*/

class  PlatDomain extends  Model{

    /*
     *初始化操作
     * */

    public function __construct() {
        parent::__construct();
    }

    /**
     * 获取已绑定IP的服务器组
     *
     * @return array
     */
    public function getServerGroup() {
        //构建sql
        $sql = "SELECT 
                  server_group.server_group_id id,server_group.server_name name 
                FROM 
                  `server_group_ip`
                LEFT JOIN server_group ON server_group_ip.server_group_id = server_group.server_group_id
                LEFT JOIN server_ip ON server_group_ip.ip_id = server_ip.ip_id
                where server_ip.ip_type in (1,3)
                 GROUP BY server_group.server_group_id";
        //组合完整sql 进行查询
        $data = $this->db->query($sql);

        return $data;
    }
}
